<template>
  <div>
    <table>
      <thead>
        <tr>
          <th>id</th>
          <th>Name</th>
          <th>age</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="item in list" :key="item.id">
          <!-- <th>{{ item.id }}</th>
          <th>{{ item.name }}</th>
          <th>{{ item.age }}</th> -->
          <slot :user="item"></slot>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script>
export default {
  name: 'MyTable',
  data() {
    return {
      list: [
        { id: 1, name: '张三', age: 18 },
        { id: 2, name: '李四', age: 27 },
        { id: 3, name: '王五', age: 18 },
        { id: 4, name: '老六', age: 24 }
      ]
    }
  }
}
</script>

<style>

</style>